package remin;

import java.awt.Color;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.JTextField;

public class PridForm extends JFrame {
	
	PFLis pfl = new PFLis();
	public static JTextField den,mesiac,rok,hod,min,pret;
	public static JTextArea pozt;
	public static JComboBox priot;
	
		public PridForm(){
		
		super("Pridavaci formular");
		setSize(400,300);
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setLayout(null);
		
		JLabel vypln = new JLabel("Vypln formular pre pridanie udalosti:",JLabel.CENTER);
		JLabel vypdat = new JLabel("Zadaj datum a cas: ");
		den = new JTextField(2);
		JLabel bodkad = new JLabel(".",JLabel.LEFT);
		mesiac = new JTextField(3);
		JLabel bodkam = new JLabel(".",JLabel.LEFT);
		JLabel rr = new JLabel("20");
		rok = new JTextField(2);
		hod = new JTextField(2);
		JLabel dvojb = new JLabel(":",JLabel.CENTER);
		min = new JTextField(2);
		JLabel predm = new JLabel("Predmet: ");
		pret = new JTextField();
		JLabel prio = new JLabel("Priorita: ");
		priot = new JComboBox();
		priot.addItem("Stredna");
		priot.addItem("Vysoka");
		priot.addItem("Nizka");
		JLabel pozn = new JLabel("Poznamka: ");
		pozt = new JTextArea(4,20);
		pozt.setBorder(BorderFactory.createLineBorder(Color.darkGray, 1));
		pozt.setLineWrap(true);
		JButton okprid = new JButton("OK,pridaj");
		JButton clear = new JButton("Vymaz formular");
		
		okprid.addActionListener(pfl);
		clear.addActionListener(pfl);
		
		
		
		vypln.setBounds(10, 10, 400, 30);
		vypdat.setBounds(10, 50, 120, 30);
		den.setBounds(140, 50, 20, 20);
		bodkad.setBounds(160, 50, 10, 20);
		mesiac.setBounds(170, 50, 20, 20);
		bodkam.setBounds(190, 50, 10, 20);
		rr.setBounds(200, 50, 15, 20);
		rok.setBounds(215, 50, 20, 20);
		hod.setBounds(260, 50, 20, 20);
		dvojb.setBounds(280, 50, 5, 20);
		min.setBounds(285, 50, 20, 20);
		predm.setBounds(10,80,100,20);
		pret.setBounds(140,80,200,20);
		prio.setBounds(10,110,50,20);
		priot.setBounds(140,110,200,20);
		pozn.setBounds(10,140,100,20);
		pozt.setBounds(140, 140, 200, 50);
		okprid.setBounds(60, 220, 130, 30);
		clear.setBounds(210,220,130,30);
		
		add(vypln);
		add(vypdat);
		add(den);
		add(bodkad);
		add(mesiac);
		add(bodkam);
		add(rr);
		add(rok);
		add(hod);
		add(dvojb);
		add(min);
		add(predm);
		add(pret);
		add(prio);
		add(priot);
		add(pozn);
		add(pozt);
		add(okprid);
		add(clear);
		setVisible(true);
	}
		
		
		

}
